﻿using Entity.WMS.DTO.WarehouseSale;
using Microsoft.AspNetCore.Mvc;
using Service.WMS;

namespace WebApi.Controllers.WMS
{
    [Route("api/[controller]")]
    [ApiController]
    public class WarehouseSaleController : ControllerBase
    {
        private readonly WarehouseSaleService _warehouseSaleService;

        // 构造函数注入
        public WarehouseSaleController(WarehouseSaleService warehouseSaleService)
        {
            _warehouseSaleService = warehouseSaleService;
        }

        /// <summary>
        /// 获取销售出库单列表
        /// </summary>
        /// <param name="warehouseSaleSearchDTO">销售出库单搜索条件</param>
        [HttpGet]
        public async Task<IActionResult> GetWarehouseSaleList([FromQuery] WarehouseSaleSearchDTO warehouseSaleSearchDTO)
        {
            var response = await _warehouseSaleService.GetWarehouseSaleList(warehouseSaleSearchDTO);
            return StatusCode(response.Status, response);
        }
    }
}
